<?php
include("gestione/includes/config.inc.php");
include("gestione/includes/auth.lib.php");
include("gestione/includes/function.inc.php");
$qry = "SELECT idbanner,imageurl,clickurl,alttext FROM banner WHERE 
attivo=1 AND sezione='mrpiscina' AND posizione='alto' AND NOW() >= startDate AND NOW() <= endDate ORDER BY ordine;";
$rs = $conn->Execute($qry);
if($rs->RecordCount()>0) {
	$xml = '';
	while(!$rs->EOF) {
		$xml .= '<imgSlider>
<src>http://mrpiscina.bsvillage.com/gestione/imgs_Banner/'.$rs->Fields("idbanner").'/'.$rs->Fields("imageurl").'</src>
<text>Promozione '.$rs->Fields("alttext").'</text>
<href>'.($rs->Fields("alttext")!="" ? "promozioni/".strPermalink($rs->Fields("alttext"))."/" : htmlentities($rs->Fields("clickurl"))).'</href>
</imgSlider>';
		$rs->MoveNext();
	}
	$rs->Close();
}
header ("content-type: text/xml");
echo '<?xml version="1.0" encoding="iso-8859-1"?>
<imgsSlider>'.$xml.'</imgsSlider>';
?>